<?php
$dir = opendir("./music/");
$files = array();
while($file = readdir($dir)) {
    if($file == '.' || $file == "..")
        continue;
    array_push($files, $file);
}
echo json_encode($files);